package com.hackaton.ui;


import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.hackaton.MyActivity;
import com.hackaton.R;
import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
// import com.slidingmenu.lib.SlidingMenu;

/**
 * Created with IntelliJ IDEA.
 * User: magiman
 * Date: 10/20/13
 * Time: 1:24 AM
 * To change this template use File | Settings | File Templates.
 */


public class CustomSlidingMenu extends SlidingMenu {
    private static CustomSlidingMenu menu;

    public static CustomSlidingMenu getInstance(Activity activity) {
        if (menu == null) {
            menu = new CustomSlidingMenu(activity);
            menu.setMode(SlidingMenu.LEFT);
            menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
            menu.setShadowWidthRes(R.dimen.shadow_width);
            menu.setShadowDrawable(R.drawable.shadow);
         //   menu.setSecondaryShadowDrawable(R.drawable.shadow_inverted);
            menu.setBehindOffsetRes(R.dimen.slidingmenu_offset);
            menu.setFadeDegree(0.35f);
            menu.setMenu(R.layout.sliding_menu_left);
           // menu.setSecondaryMenu(R.layout.sliding_menu_right);
            menu.attachToActivity(activity, SlidingMenu.SLIDING_WINDOW);
        }
        return menu;
    }

    public void disable() {
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
    }

    public void enable() {
        menu.setTouchModeAbove(SlidingMenu.TOUCHMODE_FULLSCREEN);
    }

    public static void reinit() {
        if (menu != null) {
            menu = null;
        }
    }

    public CustomSlidingMenu(Activity activity) {
        super(activity);
    }
}
